package com.kamistoat.meimeimall.meimeimallproduct.web;

import com.kamistoat.meimeimall.common.annotation.DubboAndHTTPExceptionCatch;
import com.kamistoat.meimeimall.common.annotation.LoginRequired;
import com.kamistoat.meimeimall.common.utils.R;
import com.kamistoat.meimeimall.meimeimallproduct.service.AttrService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "商品属性管理页面")
@RestController
@RequestMapping("web")
public class AttrManagePageController {
    protected Logger logger = LoggerFactory.getLogger(AttrManagePageController.class);

    @Autowired
    AttrService attrService;

    @ApiOperation("生成商品属性测试数据")
    @GetMapping("/construct_test_attr_data")
    // @LoginRequired
    @DubboAndHTTPExceptionCatch
    public R constructTestAttrData(@RequestParam("attrGroupNum") Integer attrGroupNum,
                                   @RequestParam("baseAttrNum") Integer baseAttrNum,
                                   @RequestParam("saleAttrNum") Integer saleAttrNum){
        attrService.constructTestAttrData(attrGroupNum, baseAttrNum, saleAttrNum);
        return R.ok();
    }
}
